package com.tjetc.controller;

import com.tjetc.service.Impl.SnowflakeIdWorkerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SnowController {
    @Autowired
    private SnowflakeIdWorkerService snowflakeIdWorkerService;

    /***
     * 雪花算法生成订单编号
     * @return
     */
    @RequestMapping("snow")
    public Long getSnowId(){
        return snowflakeIdWorkerService.generateUserId();
    }
}
